<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			span {
				display: inline-block;
				width: 60px;
			}
		</style>
	</head>
	<body>
		<script type="text/javascript">
			//1.求1+2+...100=和;
			/* var s = 0;
			for (var i = 0; i <= 100; i++) {
				s = s + i;
			}
			console.log("1+2+...100=和是：",s);
			 */

			//2.求1-100之间,既是3的倍数又是5的倍数;

			/* for (var i = 1; i <= 100; i++) {
				if(i%3 == 0 && i%5 == 0){
					console.log("1-100之间,既是3的倍数又是5的倍数",i);
				}
			} */

			//3.求一下的值

			/* 	 0+5
				 1+4
				 2+3
				 3+2
				 4+1
				 5+0 */

			/* 	for (var i = 0; i <=5; i++) {
				    var j=5-i;
					var s=i+j;
					document.write(i+"+"+j+"="+s+"<br />");
				} */

			//4.求2,-4,6,-8....n,求第n个值是多少?
			/* var n = prompt("请输入n",1);
			var s =0;
			for (var i = 1; i <=n; i++) {
				if(n%2 == 0){
					s=-2*i;
				}else{
					s=2*i;
				}
			}
			alert("第"+n+"个值是"+s);
			 */

			//作业03.html 
			/* for (var i = 0; i <5; i++) {
				for(var j=0;j<5;j++){
					document.write("*");
				}
				document.write("<br />");
			} */

			/* *****
			 *****
			 *****
			 *****
			 ***** */
			/* 
			for (var i = 0; i <5; i++) {
				for(var j=0;j<=i;j++){
					document.write("*");
				}
				document.write("<br />");
			}
			 */

			/* *
			 **
			 ***
			 ****
			 ***** */

			/* for (var i = 0; i<5; i++) {
				for(var j=0;j<5-i;j++){
					document.write("*");
				}
				document.write("<br />");
			} */

			/* *****
			 ****
			 ***
			 **
			 * 
			 */

			
		</script>
	</body>
</html>
